'use strict';
/**
 * @params {表单数据}
 * @business {注册}
 * @author {JC}
 * **/
const Controller = require('egg').Controller;
const tools = require('./utils/tool')
class Register extends Controller {
    async register() {
        const {
            ctx
        } = this;
        const data = ctx.request.body;
        // 注册信息
        const params = {
            id:tools.createRandomId(),
            email:data.email,
            create_time:tools.getDate(),
            password:data.password,
        }
        let result = await ctx.service.register.getRegister(params);
        ctx.body = {
            msg: 200,
            data: result,
            code: 2002
        }
    }
}

module.exports = Register